package com.bawei.rk_01.Room

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query

@Dao
interface SearchDao {

    //新增
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(searchEntity: SearchEntity)
    //查询
    @Query("select * from search where phone = :phone")
    fun query(phone:String) : MutableList<SearchEntity>
    //删除一个
    @Delete
    fun delete(searchEntity: SearchEntity)
    //删除全部
    @Query("delete from search where phone = :phone")
    fun deleteAll(phone: String)

}